# Contributor: Francesco Camuffo <dev@fmac.xyz>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=ugrep
pkgver=6.0.0
pkgrel=0
pkgdesc="Ultra fast grep with interactive query UI and fuzzy search"
url="https://ugrep.com/"
arch="all"
license="BSD-3-Clause"
checkdepends="bash"
makedepends="
	brotli-dev
	bzip2-dev
	bzip3-dev
	linux-headers
	lz4-dev
	pcre2-dev
	xz-dev
	zlib-dev
	zstd-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/Genivia/ugrep/archive/refs/tags/v$pkgver.tar.gz"

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--with-bzip3
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
cb67fa088e372d2e59d707366d23dde386102a54fb829d00b17e11469b5e05c44dc2891ba8d157100674e77fbf4267a33d9ab5bd31fa2d1655859b0643cf6930  ugrep-6.0.0.tar.gz
"
